import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from webdriver_manager.chrome import ChromeDriverManager


#1、打开浏览器 --- 驱动管理
ChromeIns = ChromeDriverManager().install()

#创建谷歌浏览器驱动对象
driver = webdriver.Chrome(service=Service(ChromeIns))

driver.get("https://www.baidu.com")
ret = driver.find_elements(By.CSS_SELECTOR,"#s-hotsearch-wrapper")
for i in ret:
    print(i.text) #获取每个元素对应的文本信息

driver.quit()


